﻿je_warlord_china = {
	icon = "gfx/interface/icons/event_icons/event_fire.dds"

	immediate = {
		random_law = {
			limit = { type = law_type:law_monarchy }
			save_scope_as = monarchy_scope
		}
	}

	complete = {
		scope:journal_entry = {
			is_goal_complete = yes
		}
		custom_tooltip = {
			text = warlord_china_criteria
		}
	}

	fail = {
		NOT = {
		country_has_primary_culture = cu:manchu
		}
	}

	on_complete = {
		trigger_event = { id = warlord_china_events.100 }
	}

	current_value = {
		value = var:china_warlord_explosion
	}

	goal_add_value = {
		add = 5
	}
	
	progressbar = yes

	on_weekly_pulse = {
		effect = {
			if = {
				limit = {
					NOT = { has_variable = china_warlord_explosion_subject }
					is_subject = yes
				}
				post_notification = warlord_china_explosion_point_add
				change_variable = {
					name = china_warlord_explosion
					add = 1
				}
				set_variable = china_warlord_explosion_subject
			}
			if = {
				limit = {
					NOT = { has_variable = china_warlord_explosion_recognized }
					country_rank != rank_value:unrecognized_power
					country_rank != rank_value:unrecognized_major_power
					country_rank != rank_value:unrecognized_regional_power
				}
				set_variable = china_warlord_explosion_recognized
				post_notification = warlord_china_explosion_point_remove
				change_variable = {
					name = china_warlord_explosion
					subtract = 1
				}
			}
			if = {
				limit = {
					NOT = { has_variable = china_abolished_monarchy }
					NOT = { has_law = law_type:law_monarchy }
				}
				set_variable = china_abolished_monarchy
				post_notification = warlord_china_explosion_point_add
				change_variable = {
					name = china_warlord_explosion
					add = 1
				}
				if = {
					limit = {
						NOT = { has_variable = china_han_empire }
					}
					trigger_event = { id = boxer_rebellion_events.4 days = 0 popup = yes }
				}
			}
		}
	}

	weight = 10000
	should_be_pinned_by_default = yes
}
